package com.abner.activiti;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Deployment;

/**
 * @description:流程部署
 * @author: guoc
 * @createDate: 2020/9/9 16:52
 */
public class activitiDeployment {


    /**
     * 影响的数据表
     * act_ge_bytearray     部署信息
     * act_re_deployment    流程定义的信息
     * act_re_procdef       流程定义的bpmn&png文件
     * @return void
     * @author guoc
     * @date 2020/9/9 17:36
     */
    public static void main(String[] args) {
        //1.获取processEngine
        ProcessEngine configuration = ProcessEngines.getDefaultProcessEngine();
        //2.获取RepositoryService
        RepositoryService repositoryService = configuration.getRepositoryService();
        //3.部署
//        DeploymentBuilder deploymentBuilder = repositoryService.createDeployment();
//        deploymentBuilder.name("请假流程").addClasspathResource("Designer/hoilday.bpmn").addClasspathResource("Designer/hoilday.png");
//        Deployment deploy = deploymentBuilder.deploy();
        Deployment deploy = repositoryService.createDeployment()
                .addClasspathResource("designer/game.bpmn")
                .addClasspathResource("designer/game.png")
                .name("DNF").deploy();
        //4.输出部署的信息
        System.out.println("流程名字"+deploy.getName());
        System.out.println("部署时间"+deploy.getDeploymentTime());
    }


}
